Release 10.1A: OpenEdge Development:
Programming Interfaces


Implementing a 4GL socket server

This section describes how to implement a 4GL socket server.

To implement a socket server:

  1. Create a server socket object using the CREATE SERVER-SOCKET statement.
  2. Enable the server socket to listen for connections using the ENABLE-CONNECTIONS( ) method. This assigns the socket to a specified TCP/IP port on which Progress listens and accepts connection requests.
  3. Note: ENABLE-CONNECTIONS() also lets you set the length of the pending-connection queue. For more information, see the reference entry for the ENABLE-CONNECTION() method in the OpenEdge Development: Progress 4GL Reference .

  4. Specify a CONNECT event procedure using the SET-CONNECT-PROCEDURE( ) method.
  5. Wait for CONNECT events using a blocking I/O statement or poll for CONNECT events using the PROCESS EVENTS statement.

Once you have a connection established from a client, you can read data from and write data to the client on the connection. You can also manage the server socket that you have enabled for listening.

The following sections describe these steps in more detail.


Copyright © 2005 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095